package com.chengh.springboot.async;

import com.chengh.springboot.async.manager.AsyncManager;
import com.chengh.springboot.async.manager.factory.AsyncFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringbootAsyncApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringbootAsyncApplication.class,args);
        ayscTest();//在此处进行测试
    }

    public static void ayscTest() {
        long start = System.currentTimeMillis();
        System.out.println("AsyncManagerTest.execute()..." + Thread.currentThread().getName());
        AsyncManager.me().execute(AsyncFactory.test1("我是测试任务1"));
        AsyncManager.me().execute(AsyncFactory.test1("我是测试任务2"));
        long end = System.currentTimeMillis();
        System.out.println("总共耗时： " + (end - start));
    }
}